// ========================================================================= //

// includes
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include "string.h"
#include "limits.h"
#include "float.h"



#define JOTAI_NUM_RANDS_ 25

const unsigned rand_primes[JOTAI_NUM_RANDS_] = {179, 103, 479, 647, 229, 37, 271, 557, 263, 607, 18743, 50359, 21929, 48757, 98179, 12907, 52937, 64579, 49957, 52567, 507163, 149939, 412157, 680861, 757751};

int next_i() {
  int counter = 0;
  return rand_primes[(++counter)%JOTAI_NUM_RANDS_];
}

float next_f() {
  int counter = 0;
  return rand_primes[(++counter)%JOTAI_NUM_RANDS_] / 757751.0F;
} 


// Usage menu
void usage() {
    printf("%s", "Usage:\n\
    prog [ARGS]\n\
\nARGS:\n\
       0            big-arr\n\
       1            big-arr-10x\n\
       2            empty\n\
\n\
");

}


// ------------------------------------------------------------------------- //

#define NULL ((void*)0)
typedef unsigned long size_t;  // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__;  // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct iscsi_stats {scalar_t__ custom_length; int /*<<< orphan*/  tmfrsp_pdus; int /*<<< orphan*/  tmfcmd_pdus; int /*<<< orphan*/  r2t_pdus; int /*<<< orphan*/  datain_pdus; int /*<<< orphan*/  scsirsp_pdus; int /*<<< orphan*/  dataout_pdus; int /*<<< orphan*/  scsicmd_pdus; int /*<<< orphan*/  rxdata_octets; int /*<<< orphan*/  txdata_octets; } ;
struct iscsi_conn {int /*<<< orphan*/  tmfrsp_pdus_cnt; int /*<<< orphan*/  tmfcmd_pdus_cnt; int /*<<< orphan*/  r2t_pdus_cnt; int /*<<< orphan*/  datain_pdus_cnt; int /*<<< orphan*/  scsirsp_pdus_cnt; int /*<<< orphan*/  dataout_pdus_cnt; int /*<<< orphan*/  scsicmd_pdus_cnt; int /*<<< orphan*/  rxdata_octets; int /*<<< orphan*/  txdata_octets; } ;
struct iscsi_cls_conn {struct iscsi_conn* dd_data; } ;

/* Variables and functions */

__attribute__((used)) static void
iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
{
	struct iscsi_conn *conn = cls_conn->dd_data;

	stats->txdata_octets = conn->txdata_octets;
	stats->rxdata_octets = conn->rxdata_octets;
	stats->scsicmd_pdus = conn->scsicmd_pdus_cnt;
	stats->dataout_pdus = conn->dataout_pdus_cnt;
	stats->scsirsp_pdus = conn->scsirsp_pdus_cnt;
	stats->datain_pdus = conn->datain_pdus_cnt; /* always 0 */
	stats->r2t_pdus = conn->r2t_pdus_cnt; /* always 0 */
	stats->tmfcmd_pdus = conn->tmfcmd_pdus_cnt;
	stats->tmfrsp_pdus = conn->tmfrsp_pdus_cnt;
	stats->custom_length = 0;
}

// ------------------------------------------------------------------------- //

int main(int argc, char *argv[]) {

    if (argc != 2) {
        usage();
        return 1;
    }

    int opt = atoi(argv[1]);
    switch(opt) {

    // big-arr
    case 0:
    {
          int _len_cls_conn0 = 65025;
          struct iscsi_cls_conn * cls_conn = (struct iscsi_cls_conn *) malloc(_len_cls_conn0*sizeof(struct iscsi_cls_conn));
          for(int _i0 = 0; _i0 < _len_cls_conn0; _i0++) {
              int _len_cls_conn__i0__dd_data0 = 1;
          cls_conn[_i0].dd_data = (struct iscsi_conn *) malloc(_len_cls_conn__i0__dd_data0*sizeof(struct iscsi_conn));
          for(int _j0 = 0; _j0 < _len_cls_conn__i0__dd_data0; _j0++) {
              cls_conn[_i0].dd_data->tmfrsp_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->tmfcmd_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->r2t_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->datain_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->scsirsp_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->dataout_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->scsicmd_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->rxdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->txdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
        
          }
        
          }
        
          int _len_stats0 = 65025;
          struct iscsi_stats * stats = (struct iscsi_stats *) malloc(_len_stats0*sizeof(struct iscsi_stats));
          for(int _i0 = 0; _i0 < _len_stats0; _i0++) {
              stats[_i0].custom_length = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].tmfrsp_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].tmfcmd_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].r2t_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].datain_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].scsirsp_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].dataout_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].scsicmd_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].rxdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].txdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
        
          }
        
          iscsi_iser_conn_get_stats(cls_conn,stats);
          for(int _aux = 0; _aux < _len_cls_conn0; _aux++) {
          free(cls_conn[_aux].dd_data);
          }
          free(cls_conn);
          free(stats);
        
        break;
    }
    // big-arr-10x
    case 1:
    {
          int _len_cls_conn0 = 100;
          struct iscsi_cls_conn * cls_conn = (struct iscsi_cls_conn *) malloc(_len_cls_conn0*sizeof(struct iscsi_cls_conn));
          for(int _i0 = 0; _i0 < _len_cls_conn0; _i0++) {
              int _len_cls_conn__i0__dd_data0 = 1;
          cls_conn[_i0].dd_data = (struct iscsi_conn *) malloc(_len_cls_conn__i0__dd_data0*sizeof(struct iscsi_conn));
          for(int _j0 = 0; _j0 < _len_cls_conn__i0__dd_data0; _j0++) {
              cls_conn[_i0].dd_data->tmfrsp_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->tmfcmd_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->r2t_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->datain_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->scsirsp_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->dataout_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->scsicmd_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->rxdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->txdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
        
          }
        
          }
        
          int _len_stats0 = 100;
          struct iscsi_stats * stats = (struct iscsi_stats *) malloc(_len_stats0*sizeof(struct iscsi_stats));
          for(int _i0 = 0; _i0 < _len_stats0; _i0++) {
              stats[_i0].custom_length = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].tmfrsp_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].tmfcmd_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].r2t_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].datain_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].scsirsp_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].dataout_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].scsicmd_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].rxdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].txdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
        
          }
        
          iscsi_iser_conn_get_stats(cls_conn,stats);
          for(int _aux = 0; _aux < _len_cls_conn0; _aux++) {
          free(cls_conn[_aux].dd_data);
          }
          free(cls_conn);
          free(stats);
        
        break;
    }
    // empty
    case 2:
    {
          int _len_cls_conn0 = 1;
          struct iscsi_cls_conn * cls_conn = (struct iscsi_cls_conn *) malloc(_len_cls_conn0*sizeof(struct iscsi_cls_conn));
          for(int _i0 = 0; _i0 < _len_cls_conn0; _i0++) {
              int _len_cls_conn__i0__dd_data0 = 1;
          cls_conn[_i0].dd_data = (struct iscsi_conn *) malloc(_len_cls_conn__i0__dd_data0*sizeof(struct iscsi_conn));
          for(int _j0 = 0; _j0 < _len_cls_conn__i0__dd_data0; _j0++) {
              cls_conn[_i0].dd_data->tmfrsp_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->tmfcmd_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->r2t_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->datain_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->scsirsp_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->dataout_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->scsicmd_pdus_cnt = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->rxdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
          cls_conn[_i0].dd_data->txdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
        
          }
        
          }
        
          int _len_stats0 = 1;
          struct iscsi_stats * stats = (struct iscsi_stats *) malloc(_len_stats0*sizeof(struct iscsi_stats));
          for(int _i0 = 0; _i0 < _len_stats0; _i0++) {
              stats[_i0].custom_length = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].tmfrsp_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].tmfcmd_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].r2t_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].datain_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].scsirsp_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].dataout_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].scsicmd_pdus = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].rxdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
          stats[_i0].txdata_octets = ((-2 * (next_i()%2)) + 1) * next_i();
        
          }
        
          iscsi_iser_conn_get_stats(cls_conn,stats);
          for(int _aux = 0; _aux < _len_cls_conn0; _aux++) {
          free(cls_conn[_aux].dd_data);
          }
          free(cls_conn);
          free(stats);
        
        break;
    }
    default:
        usage();
        break;

    }

    return 0;
}
